<template>
  <el-button type="primary" :icon="Plus" @click="showAddDialog(1)">新增用户</el-button>
  <el-button type="success" :icon="EditPen" @click="showAddDialog(2)">编辑用户</el-button>
  <AddDialog ref="addDialogRef" />
</template>
<script setup lang="ts">
import { ref } from 'vue'
import AddDialog from './views/Dialog.vue'
import { EditPen, Plus } from '@element-plus/icons-vue'
const addDialogRef = ref<InstanceType<typeof AddDialog>>()

const showAddDialog = (mode: number) => {
  addDialogRef.value?.open(mode)
}
</script>